#!/bin/bash

WORK_PATH=`pwd`

DEPLOY_TARGET="ftdev@gtig"
DEPLOY_DIRECTORY="/home/ftdev/java/cuba/gtig"

rsync -ruz --progress --delete --exclude-from="${WORK_PATH}/deploy/exclude.list" "${WORK_PATH}/build/tomcat/" ${DEPLOY_TARGET}:${DEPLOY_DIRECTORY}/

scp "${WORK_PATH}/deploy/real/context.xml" ${DEPLOY_TARGET}:${DEPLOY_DIRECTORY}/webapps/app-core/META-INF/

ssh ${DEPLOY_TARGET} "${DEPLOY_DIRECTORY}/bin/shutdown.sh"
sleep 15
ssh ${DEPLOY_TARGET} "${DEPLOY_DIRECTORY}/bin/startup.sh"
